/**
 */
package org.autosar.schema.r4.impl;

import org.autosar.schema.r4.DATAELEMENTTYPE;
import org.autosar.schema.r4.R4Package;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>DATAELEMENTTYPE</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * </p>
 * <ul>
 *   <li>{@link org.autosar.schema.r4.impl.DATAELEMENTTYPEImpl#getSHORTNAME <em>SHORTNAME</em>}</li>
 *   <li>{@link org.autosar.schema.r4.impl.DATAELEMENTTYPEImpl#getDATAID <em>DATAID</em>}</li>
 *   <li>{@link org.autosar.schema.r4.impl.DATAELEMENTTYPEImpl#getDATATYPE <em>DATATYPE</em>}</li>
 * </ul>
 *
 * @generated
 */
public class DATAELEMENTTYPEImpl extends MinimalEObjectImpl.Container implements DATAELEMENTTYPE {
	/**
	 * The default value of the '{@link #getSHORTNAME() <em>SHORTNAME</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSHORTNAME()
	 * @generated
	 * @ordered
	 */
	protected static final String SHORTNAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getSHORTNAME() <em>SHORTNAME</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getSHORTNAME()
	 * @generated
	 * @ordered
	 */
	protected String sHORTNAME = SHORTNAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getDATAID() <em>DATAID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDATAID()
	 * @generated
	 * @ordered
	 */
	protected static final int DATAID_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getDATAID() <em>DATAID</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDATAID()
	 * @generated
	 * @ordered
	 */
	protected int dATAID = DATAID_EDEFAULT;

	/**
	 * This is true if the DATAID attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean dATAIDESet;

	/**
	 * The default value of the '{@link #getDATATYPE() <em>DATATYPE</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDATATYPE()
	 * @generated
	 * @ordered
	 */
	protected static final String DATATYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getDATATYPE() <em>DATATYPE</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDATATYPE()
	 * @generated
	 * @ordered
	 */
	protected String dATATYPE = DATATYPE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DATAELEMENTTYPEImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return R4Package.Literals.DATAELEMENTTYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getSHORTNAME() {
		return sHORTNAME;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSHORTNAME(String newSHORTNAME) {
		String oldSHORTNAME = sHORTNAME;
		sHORTNAME = newSHORTNAME;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, R4Package.DATAELEMENTTYPE__SHORTNAME, oldSHORTNAME, sHORTNAME));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getDATAID() {
		return dATAID;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDATAID(int newDATAID) {
		int oldDATAID = dATAID;
		dATAID = newDATAID;
		boolean oldDATAIDESet = dATAIDESet;
		dATAIDESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, R4Package.DATAELEMENTTYPE__DATAID, oldDATAID, dATAID, !oldDATAIDESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetDATAID() {
		int oldDATAID = dATAID;
		boolean oldDATAIDESet = dATAIDESet;
		dATAID = DATAID_EDEFAULT;
		dATAIDESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, R4Package.DATAELEMENTTYPE__DATAID, oldDATAID, DATAID_EDEFAULT, oldDATAIDESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetDATAID() {
		return dATAIDESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getDATATYPE() {
		return dATATYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDATATYPE(String newDATATYPE) {
		String oldDATATYPE = dATATYPE;
		dATATYPE = newDATATYPE;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, R4Package.DATAELEMENTTYPE__DATATYPE, oldDATATYPE, dATATYPE));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case R4Package.DATAELEMENTTYPE__SHORTNAME:
				return getSHORTNAME();
			case R4Package.DATAELEMENTTYPE__DATAID:
				return getDATAID();
			case R4Package.DATAELEMENTTYPE__DATATYPE:
				return getDATATYPE();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case R4Package.DATAELEMENTTYPE__SHORTNAME:
				setSHORTNAME((String)newValue);
				return;
			case R4Package.DATAELEMENTTYPE__DATAID:
				setDATAID((Integer)newValue);
				return;
			case R4Package.DATAELEMENTTYPE__DATATYPE:
				setDATATYPE((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case R4Package.DATAELEMENTTYPE__SHORTNAME:
				setSHORTNAME(SHORTNAME_EDEFAULT);
				return;
			case R4Package.DATAELEMENTTYPE__DATAID:
				unsetDATAID();
				return;
			case R4Package.DATAELEMENTTYPE__DATATYPE:
				setDATATYPE(DATATYPE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case R4Package.DATAELEMENTTYPE__SHORTNAME:
				return SHORTNAME_EDEFAULT == null ? sHORTNAME != null : !SHORTNAME_EDEFAULT.equals(sHORTNAME);
			case R4Package.DATAELEMENTTYPE__DATAID:
				return isSetDATAID();
			case R4Package.DATAELEMENTTYPE__DATATYPE:
				return DATATYPE_EDEFAULT == null ? dATATYPE != null : !DATATYPE_EDEFAULT.equals(dATATYPE);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuilder result = new StringBuilder(super.toString());
		result.append(" (sHORTNAME: ");
		result.append(sHORTNAME);
		result.append(", dATAID: ");
		if (dATAIDESet) result.append(dATAID); else result.append("<unset>");
		result.append(", dATATYPE: ");
		result.append(dATATYPE);
		result.append(')');
		return result.toString();
	}

} //DATAELEMENTTYPEImpl
